import requests
head = {
        "authorization": "Basic ZGV5dW5jZTo4MjgxMjM=",
        "content-type": "application/json"
    }   #把局域变量 变成全局变量   另一个文件就可以import

def mode(m,suff,**data):
    pre = "https://mall.deyunce.com"
    if m == "post":
        res = requests.request(method=m,url=pre+suff,json=data,headers=head)
        return res
    elif m == "get":
        res = requests.request(method=m, url=pre + suff, params=data, headers=head)
        return res

